import java.util.HashSet;


public class Random
{
	public static boolean getRandomBoolean( final double trueProbability )
	{
		return Math.random() < trueProbability;
	}
	public static int getRandomSign()
	{
		return getRandomNumber(10, 1000)%2 == 0 ? -1 : 1;
	}
	public static int getRandomNumber(int min, int max)
	{
		return min + (int)(Math.random() * (max - min));
	}	
	public static double getRandomPositiveReal(final double max)
	{
		return Math.random()*max;
	}
	public static String getRandomString( final int tam , final String s )
	{
		String ans = "";

		for (int i = 0; i < tam; i++)
		{
			int id = getRandomNumber(0, s.length());
			ans += s.charAt(id);
		}
		return ans;
	}
}
